﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using Exhibition.Dao.ViewModel;
using Exhibition.Service;

namespace Exhibition.WebService
{
    // 注意: 使用“重构”菜单上的“重命名”命令，可以同时更改代码、svc 和配置文件中的类名“CommService”。
    // 注意: 为了启动 WCF 测试客户端以测试此服务，请在解决方案资源管理器中选择 CommService.svc 或 CommService.svc.cs，然后开始调试。
    public class CommService : ICommService
    {

        #region 颜色方案
        /// <summary>
        /// 添加颜色方案
        /// </summary>
        /// <param name="mdl"></param>
        /// <returns></returns>
        public int SaveColorModel(ColorTypeModel mdl)
        {
            return CenterService.colorTypeService.Save(mdl);
        }

        /// <summary>
        /// 获取颜色方案
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public ColorTypeModel GetColorById(int id)
        {
            return CenterService.colorTypeService.GetOneById(id);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public List<ColorTypeModel> GetColorList() {
            return CenterService.colorTypeService.GetColorList();
        }

        /// <summary>
        /// 删除颜色方案
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public int DelColorModel(int id)
        {
            return CenterService.colorTypeService.DelById(id);
        }
        #endregion

        #region 楼层

        /// <summary>
        /// 保存楼层信息
        /// </summary>
        /// <param name="flm"></param>
        /// <returns></returns>
        public int SaveFloorModel(FloorModel flm)
        {
            return CenterService.floorService.Save(flm);
        }

        /// <summary>
        /// 获取楼层
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public FloorModel GetFloorById(int id)
        {
            return CenterService.floorService.GetOneById(id);
        }


        #endregion
        #region 展位
        /// <summary>
        /// 添加更新
        /// </summary>
        /// <param name="stmdl"></param>
        /// <returns></returns>
        public int SaveStand(StandModel stmdl)
        {
            return CenterService.standService.Save(stmdl);
        }

        public List<StandModel> GetStandList(string key)
        {
            return CenterService.standService.SearchStand(key);
        }


        #endregion


    }
}
